import { createRouter, createWebHashHistory } from 'vue-router'

export const staticRoutes = [
  {
    path: '/',
    name: 'admin',
    redirect: '/sy',
    component: () => import('@/view/admin.vue'),
    children: [
      {
        path: '/sy',
        name: '首页',
        meta: { title: '首页', keepAlive: true },
        component: () => import('@/view/sy.vue')
      },
    ]
  },
  {
    path: '/login',
    name: 'login',
    meta: { title: '登录' },
    component: () => import('@/view/login.vue')
  }
]

export const router = createRouter({
  history: createWebHashHistory(), // hash模式，URL会带#，刷新不会404
  routes: staticRoutes
})
